<?php
namespace Home\Model;
use Think\Model;

class GoodsordersModel extends Model {
	    /**
    	 * [列表数据]
    	 * @Author   Axing
    	 * @DateTime 2017-09-11
    	 * @param    [array]     $arr [字段]
    	 * @return   [type]           [description]
    	 */
    	public function lists($arr) {
    		$data = $this->field($arr['field'])->where($arr['where_a'])->order($arr['order'])->limit($arr['startcount'], $arr['pagecount'])->select();
    		
    		return $data;
    	}

        /**
         * [未结算订单]
         * @Author   Axing
         * @DateTime 2017-09-11
         * @return   [type]     [description]
         */
        public function not_balance() {
            $data = $this->field('ordersid, shou_huo_datetime, state, blance_state, blance_price, shopid, numbers')
                         ->where('blance_state = 0 AND shou_huo_datetime != " " AND state IN (3,5)')
                         ->select();

            return $data;
        }

        /**
         * [修改订单结算状态]
         * @Author   Axing
         * @DateTime 2017-09-11
         * @param    [int]     $ordersid  [订单号]
         * @return   [type]               [description]
         */
        public function update_blance_state($ordersid) {
            $data['blance_state'] = 1;
            $data['ordersid'] = $ordersid;

            $res = $this->save($data);
        }
}